vulkan: Also wait on the draw semaphore when present()ing
authorBenjamin Otte <otte@redhat.com>
Thu, 8 Dec 2016 16:40:07 +0000 (17:40 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 9 Dec 2016 17:35:51 +0000 (18:35 +0100)
That way we have a synchronization primitive at the start and at the
end.

gdk/gdkvulkancontext.c
gsk/gskvulkanrender.c

index f0af29b8476947b7a03710d2080d58ffd6487bde..399cd984d0263aa65bfea2c3a68030d1dd0926f4 100644 (file)
@@ -306,6 +306,10 @@ gdk_vulkan_context_end_frame (GdkDrawContext *draw_context,
   GDK_VK_CHECK (vkQueuePresentKHR, gdk_vulkan_context_get_queue (context),
                                    &(VkPresentInfoKHR) {
                                        .sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
+                                       .waitSemaphoreCount = 1,
+                                       .pWaitSemaphores = (VkSemaphore[]) {
+                                           priv->draw_semaphore
+                                       },
                                        .swapchainCount = 1,
                                        .pSwapchains = (VkSwapchainKHR[]) { 
                                            priv->swapchain
index c57e701106f331fe3ebeb343fe8a8adc17dc8e3f..8fd91600ae4b69f792ed21d560c3440587b0f010 100644 (file)
@@ -237,13 +237,17 @@ gsk_vulkan_render_submit (GskVulkanRender *self,
                                   .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
                                   .waitSemaphoreCount = 1,
                                   .pWaitSemaphores = (VkSemaphore[1]) {
-                                      gdk_vulkan_context_get_draw_semaphore (self->vulkan),
+                                      gdk_vulkan_context_get_draw_semaphore (self->vulkan)
                                   },
                                   .pWaitDstStageMask = (VkPipelineStageFlags []) {
                                      VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
                                   },
                                   .commandBufferCount = 1,
                                   .pCommandBuffers = &self->command_buffer,
+                                  .signalSemaphoreCount = 1,
+                                  .pSignalSemaphores = (VkSemaphore[1]) {
+                                      gdk_vulkan_context_get_draw_semaphore (self->vulkan)
+                                  }
                                },
                                fence);